package com.room.search.service.dto.user;

import org.springframework.util.CollectionUtils;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * By   : ghd.bright
 * Time : 2022/2/15
 * Description: 管理端新增用户DTO
 */
public class RoomUserAddDTO implements Serializable {
    @Size(max = 50)
    private String nickName;

    @NotNull
    @Size(max = 30)
    private String account;

    @NotNull
    private String password;

    @Size(max = 11)
    @NotNull
    private String mobile;

    private String slogan;

    @NotNull
    private Boolean activated;

    private List<String> permIds;

    private List<String> roleIds;

    public String getNickName() {
        return nickName;
    }

    public RoomUserAddDTO setNickName(String nickName) {
        this.nickName = nickName;
        return this;
    }

    public String getAccount() {
        return account;
    }

    public RoomUserAddDTO setAccount(String account) {
        this.account = account;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public RoomUserAddDTO setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getMobile() {
        return mobile;
    }

    public RoomUserAddDTO setMobile(String mobile) {
        this.mobile = mobile;
        return this;
    }

    public String getSlogan() {
        return slogan;
    }

    public RoomUserAddDTO setSlogan(String slogan) {
        this.slogan = slogan;
        return this;
    }

    public Boolean getActivated() {
        return activated;
    }

    public RoomUserAddDTO setActivated(Boolean activated) {
        this.activated = activated;
        return this;
    }

    public String getPermIds() {
        if (CollectionUtils.isEmpty(permIds)) {
            return null;
        }
        return permIds.toString();
    }

    public RoomUserAddDTO setPermIds(List<String> permIds) {
        this.permIds = permIds;
        return this;
    }

    public List<String> getRoleIds() {
        return roleIds;
    }

    public RoomUserAddDTO setRoleIds(List<String> roleIds) {
        this.roleIds = roleIds;
        return this;
    }

    @Override
    public String toString() {
        return "RoomUserAddDTO{" +
            "nickName='" + nickName + '\'' +
            ", account='" + account + '\'' +
            ", password='" + password + '\'' +
            ", mobile='" + mobile + '\'' +
            ", slogan='" + slogan + '\'' +
            ", activated=" + activated +
            ", permIds=" + permIds +
            ", roleIds=" + roleIds +
            '}';
    }
}
